//
//  ModelTools.swift
//  CosClub
//
//  Created by iOS on 2020/4/30.
//  Copyright © 2020 ios. All rights reserved.
//

import Foundation
import UIKit

public struct ModelTools{
    
    public enum Sex {
        public static let  man = 10
        public static let  woman = 20
        public static let  unknown = 30
    }
    
    public static func sex(sex: Int?) -> String {
        guard let sexInt = sex else {
            return ""
        }
        
        if sexInt ==  Sex.man{
            return "男"
        }else if sexInt == Sex.woman{
            return "女"
        }else {
            return ""
        }
    }
    
    public static func sexImage(sex: Int?) -> UIImage? {
        guard let sexInt = sex else {
            return nil
        }
        if sexInt == Sex.man {
            return UIImage.imageFromBasis(named: "mine_sex_1")
        }else if sexInt == Sex.woman{
            return UIImage.imageFromBasis(named: "mine_sex_0")
        }else {
            return nil
        }
    }
}

